package com.bea.ftd.common.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.bea.ftd.common.enums.DateFormatEnum;
import com.bea.ftd.common.intf.IGatewayEntity;
import com.bea.ftd.common.utils.DateUtil;

import lombok.Data;

@Data
@Entity
@Table(name = "msg_out_conf")
public class MsgOutConf  implements IGatewayEntity {

	private static final long serialVersionUID = 7270267904775154925L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;

	@Column(name = "api_id")
	private String apiId;

	@Column(name = "parent_node")
	private String parentNode;

	@Column(name = "param_name")
	private String paramName;

	@Column(name = "param_note")
	private String paramNote;

	@Column(name = "param_type")
	private String paramType;

	@Column(name = "param_length")
	private Long paramLength;

	@Column(name = "encrypt_strategy")
	private Long encryptStrategy;

	@Column(name = "is_empty")
	private Long isEmpty;

	@Column(name = "is_activated")
	private Long isActivated;

	@Column(name = "create_time")
	private java.util.Date createTime;

	@Column(name = "update_time")
	private java.util.Date updateTime;
	
	public String getFormatCreateTime() {
		if (null == createTime) {
			return "";
		}
		return DateUtil.formatDate(createTime, DateFormatEnum.YEAR_MONTH_DAY_HOUR_MINUTE_SECOND);
	}

	public String getFormatUpdateTime() {
		if (null == updateTime) {
			return "";
		}
		return DateUtil.formatDate(updateTime, DateFormatEnum.YEAR_MONTH_DAY_HOUR_MINUTE_SECOND);
	}

}
